package IO;

import com.sun.xml.internal.ws.api.model.wsdl.WSDLOutput;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class AutoCloseableDemo {
    public static void main(String[] args) {
        System.out.println("start");
        try (
                FileOutputStream fos = new FileOutputStream("fos.txt");
                ){
            fos.write(1);
        } catch (IOException e) {
            e.printStackTrace();
        }
        System.out.println("end");
    }
}
